home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / cweb31p9d.lha / CWeb / makefile.pc < prev    next >
Makefile  |  1994-07-02  |  7KB  |  251 lines

  1. # This file, makefile.pc, is part of CWEB.
  2. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  3. #
  4. # Modified for the Borland Turbo C/C++ 3.1 compiler under MSDOS by
  5. # Andreas Scherer (Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany), July 1994
  6. # Last updated by Andreas Scherer, July 2, 1994
  7.  
  8. # Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  9. # Copyright (C) 1994 Andreas Scherer
  10.  
  11. # Permission is granted to make and distribute verbatim copies of this
  12. # document provided that the copyright notice and this permission notice
  13. # are preserved on all copies.
  14.  
  15. # Permission is granted to copy and distribute modified versions of this
  16. # document under the conditions for verbatim copying, provided that the
  17. # entire resulting derived work is distributed under the terms of a
  18. # permission notice identical to this one.
  19.  
  20. #
  21. # Read the README file, then edit this file to reflect local conditions
  22. #
  23.  
  24. # directory for TeX inputs (cwebmac.tex, ccwebmac.tex, or gcwebmac.tex go here)
  25. MACROSDIR= macros/
  26.  
  27. # directory for CWEB inputs in @i files
  28. CWEBINPUTS= inputs/
  29.  
  30. # extension for manual pages ("l" distinguishes local from system stuff)
  31. MANEXT= l
  32. #MANEXT= 1
  33.  
  34. # directory for manual pages (cweb.1 goes here)
  35. MANDIR=
  36.  
  37. # destination directory for executables; must end in /
  38. DESTDIR= bin/
  39.  
  40. # directory for GNU EMACS Lips code (cweb.el goes here)
  41. EMACSDIR=
  42.  
  43. # directory for the language header file "cweb.h"
  44. CATINCLUDE= bin/catalogs/
  45.  
  46. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  47. # (probably NOT a good idea; we recommend leaving DESTPREF=c)
  48. DESTPREF=c
  49.  
  50. # Set COMMONH to the name of the file `common.h' or any alternative to
  51. # the original `common.h'.
  52. COMMONH=comm-p.h
  53.  
  54. # Set CHCHANGES to comm-foo.hch if you need changes to common.h
  55. CHCHANGES=comm-p.hch
  56.  
  57. # Set CCHANGES to comm-foo.ch if you need changes to common.w
  58. CCHANGES=common.ch
  59.  
  60. # Set TCHANGES to ctang-foo.ch if you need changes to ctangle.w
  61. TCHANGES=ctangle.ch
  62.  
  63. # Set WCHANGES to cweav-foo.ch if you need changes to cweave.w
  64. WCHANGES=cweave.ch
  65.  
  66. # Set PCHANGES to prod-foo.ch if you need changes to prod.w
  67. PCHANGES=
  68.  
  69. # Set MCHANGES to wmerge-foo.ch if you need changes to wmerge.w
  70. MCHANGES=wmerge.ch
  71.  
  72. # These lists of arguments are specific for BCC.
  73. # Change, add or delete things here to suit your personal conditions.
  74. CFLAGS = -I$(CATINCLUDE) -DCWEBINPUTS="$(CWEBINPUTS)" -mh -AT
  75. LINKFLAGS = $(CFLAGS)
  76.  
  77. # By default my version of cweave includes the option for AMIGA keywords
  78. # and the use of German macros.  So you have to switch these off for all
  79. # the CWEB documentation.  Also the `f' flag is turned off to save paper
  80. WFLAGS=-fag
  81.  
  82. # What C compiler are you using?
  83. CC = bcc
  84. LINK = bcc
  85. MAKE = make
  86.  
  87. # RM and CP are used below in case rm and cp are aliased
  88. RM= del
  89. CP= copy
  90. INSTALL= copy
  91.  
  92. ##########  You shouldn't have to change anything after this point #######
  93.  
  94. CWEAVE = cweave
  95. CTANGLE = ctangle
  96. WMERGE = wmerge
  97. SOURCES = cweave.w common.w ctangle.w
  98. ALMOSTALL = common.w ctangle.w wmerge.w makefile readme \
  99.     common.c common.h $(COMMONH) ctangle.c wmerge.c \
  100.     cwebman.tex cwebmang.ch cweb.1 cweb.man cweb.el prod.w \
  101.     $(CCHANGES) $(CHCHANGES) $(TCHANGES) $(WCHANGES) $(PCHANGES) \
  102.     comm-vms.ch ctang-vms.ch cweav-vms.ch \
  103.     comm-man.ch ctang-man.ch cweav-man.ch \
  104.     makefile.amiga makefile.pc makefile.unix \
  105.     $(MACROSDIR)cwebmac.tex $(MACROSDIR)ccwebmac.tex $(MACROSDIR)gcwebmac.tex \
  106.     $(CATINCLUDE)cweb.h examples
  107. ALL =  $(ALMOSTALL) cweave.w
  108.  
  109. .SUFFIXES: .dvi .tex .w
  110.  
  111. .w.tex:
  112.     $(CWEAVE) $(WFLAGS) $* $*
  113.  
  114. .tex.dvi:       
  115.     tex $<
  116.  
  117. .w.dvi:
  118.     $(MAKE) $*.tex
  119.     $(MAKE) $*.dvi
  120.  
  121. .c.obj:
  122.     $(CC) $(CFLAGS) -c $*.c
  123.  
  124. .w.c:
  125.     $(CTANGLE) $* $*
  126.  
  127. .w.obj:
  128.     $(MAKE) $*.c
  129.     $(MAKE) $*.obj
  130.  
  131. # When you say `smake' without any arguments, `smake' will jump to this item
  132. default: ctangle.exe cweave.exe
  133.  
  134. # The complete set of files contains the two programs `ctangle' and
  135. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmang'
  136. # and the source documentations.
  137. all: progs docs
  138.  
  139. # The objects of desire
  140. progs: ctangle.exe cweave.exe wmerge.exe
  141.  
  142. cautiously: $(CTANGLE)
  143.     $(CP) common.c SAVEcommon.c
  144.     $(CTANGLE) common $(CCHANGES)
  145.     diff common.c SAVEcommon.c
  146.     $(RM) SAVEcommon.c
  147.     $(CP) ctangle.c SAVEctangle.c
  148.     $(CTANGLE) ctangle $(TCHANGES)
  149.     diff ctangle.c SAVEctangle.c
  150.     $(RM) SAVEctangle.c
  151.  
  152. SAVEctangle.c:
  153.     $(CP) ctangle.c SAVEctangle.c
  154.  
  155. SAVEcommon.c:
  156.     $(CP) common.c SAVEcommon.c
  157.  
  158. common.c: common.w $(CCHANGES)
  159.     $(CTANGLE) common $(CCHANGES)
  160.  
  161. common.obj: common.c $(CATINCLUDE)cweb.h
  162.  
  163. ctangle.exe: ctangle.obj common.obj
  164.     $(LINK) $(LINKFLAGS) ctangle.obj common.obj
  165.  
  166. ctangle.c: ctangle.w $(TCHANGES)
  167.     $(CTANGLE) ctangle $(TCHANGES)
  168.  
  169. ctangle.obj: ctangle.c $(CATINCLUDE)cweb.h $(COMMONH)
  170.  
  171. cweave.exe: cweave.obj common.obj
  172.     $(LINK) $(LINKFLAGS) cweave.obj common.obj
  173.  
  174. cweave.c: cweave.w $(WCHANGES)
  175.     $(CTANGLE) cweave $(WCHANGES)
  176.  
  177. cweave.obj: cweave.c $(CATINCLUDE)cweb.h $(COMMONH)
  178.  
  179. wmerge.exe: wmerge.c
  180.     $(CC) $(CFLAGS) wmerge.c
  181.  
  182. wmerge.c: wmerge.w $(MCHANGES)
  183.     $(CTANGLE) wmerge $(MCHANGES)
  184.  
  185. # additional rules to `wmerge' the remaining files
  186. #
  187. $(COMMONH): common.h $(CHCHANGES)
  188.     $(WMERGE) common.h $(CHCHANGES) $(COMMONH)
  189.  
  190. # Take a good lecture for bedtime reading
  191. docs: cwebman.dvi cwebmang.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  192.  
  193. cwebman.dvi: cwebman.tex
  194. cwebmang.dvi: cwebmang.tex
  195. common.dvi: common.tex
  196. ctangle.dvi: ctangle.tex
  197. cweave.dvi: cweave.tex
  198. wmerge.dvi: wmerge.tex
  199.  
  200. usermanual: cwebmang.dvi
  201.  
  202. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  203.     $(MAKE) cweave
  204.     $(CWEAVE) common.w comm-man.ch
  205.     $(MAKE) common.dvi
  206.     $(CWEAVE) ctangle.w ctang-man.ch
  207.     $(MAKE) ctangle.dvi
  208.     $(CWEAVE) cweave.w cweav-man.ch
  209.     $(MAKE) cweave.dvi
  210.  
  211. cwebmang.tex: cwebman.tex cwebmang.ch
  212.     $(WMERGE) cwebman.tex cwebmang.ch cwebmang.tex
  213.  
  214. # for making the documentation we will have to include the change files
  215. ctangle.tex: ctangle.w $(COMMONH) $(TCHANGES)
  216.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  217.  
  218. cweave.tex: cweave.w $(COMMONH) $(WCHANGES)
  219.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  220.  
  221. common.tex: common.w $(CCHANGES)
  222.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  223.  
  224. wmerge.tex: wmerge.w $(MCHANGES)
  225.     $(CWEAVE) $(WFLAGS) wmerge $(MCHANGES)
  226.  
  227. # be sure to leave ctangle.c and common.c and $(COMMONH) for bootstrapping
  228. clean:
  229.     $(RM) *.obj 
  230.     $(RM) *.bak
  231.     $(RM) *.log 
  232.     $(RM) *.dvi 
  233.     $(RM) *.toc 
  234.     $(RM) *.idx 
  235.     $(RM) *.scn 
  236.     $(RM) common.tex 
  237.     $(RM) cweave.tex 
  238.     $(RM) cweave.c 
  239.     $(RM) ctangle.tex 
  240.     $(RM) cweave.exe 
  241.     $(RM) ctangle.exe 
  242.     $(RM) cwebmang.tex 
  243.     $(RM) wmerge.tex 
  244.     $(RM) wmerge.exe
  245.  
  246. # Install the new program versions where they can be found
  247. install: bin/ctangle bin/cweave bin/wmerge $(MACROSDIR)ccwebmac.tex
  248.     $(INSTALL) cweave.exe $(DESTDIR)$(DESTPREF)weave.exe
  249.     $(INSTALL) ctangle.exe $(DESTDIR)$(DESTPREF)tangle.exe
  250.     $(INSTALL) wmerge.exe $(DESTDIR)wmerge.exe
  251.